package cn.edu.qut.edusys.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    @Select("SELECT * FROM t_exam_paper_info WHERE targetId=#{param} and status!=1")
    List<Map<String,Object>> finished(String param);

    @Select("SELECT * FROM t_exam_paper_info WHERE targetId=#{param} and status=1")
    List<Map<String,Object>> unfinished(@RequestParam String param);

    @Update("update t_exam_paper_info set " +
            " studentAnswer=#{studentAnswer},status=2" +
            " where examPaperId=#{examPaperId}")
    int submit(Map<String,String> param);

    List<Map<String,Object>> search(Map<String,String> param);
    List<Map<String,Object>> search1(Map<String,String> param);
}
